package com.yunji.app.base;

import com.yunji.base.business.MemberBusiness;
import com.yunji.common.base.BaseController;
import com.yunji.common.base.response.Response;
import com.yunji.common.base.response.ResponseHelper;
import com.yunji.common.model.domain.MemberDO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @version 1.0
 * @Project: yunji-coffee
 * @Package com.yunji.app.user
 * @FileName GateWayMemberController.java
 * @Copyright Copyright © 2024 云集互联. All Rights Reserved
 * Company		com
 * @CreateTime 2024-04-25 20:00:51
 * @Description 移动端-用户管理
 * @Modification Author                    History Time			Version				Description
 * --------------------------------------------------------------------------------
 * HuaAo				2024-04-25 20:00:51		1.0					1.0 Version
 * @since JDK 1.8.0_202
 */
@Api(tags = "移动端-用户管理")
@RequestMapping("/gateway/member")
@RestController
public class GateWayMemberController extends BaseController {
    @Resource
    MemberBusiness business;

    @ApiOperation("获取当前顾客信息")
    @GetMapping("/getMember")
    public Response<MemberDO> getMember() {
        return ResponseHelper.success(business.selectMember());
    }

    @ApiOperation("修改个人信息")
    @PostMapping("/editMember")
    public Response<String> edit(@RequestBody MemberDO member) {
        business.updateMember(member);
        return ResponseHelper.success("修改成功");
    }
}